package com.zhousb.deviceManager.controller;

import com.zhousb.deviceManager.common.R;
import com.zhousb.deviceManager.common.ResponseResult;
import com.zhousb.deviceManager.service.FloorService;
import com.zhousb.deviceManager.service.PositionService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/floor")
public class FloorController {
    @Resource
    FloorService floorService;

    @GetMapping("/list")
    public ResponseResult<?> listFloor(@RequestParam("clientId")String clientId) {
        return R.success(floorService.listFloor(clientId));
    }

    @GetMapping("/add")
    public ResponseResult<?> add(@RequestParam("clientId")String clientId,@RequestParam("floor")String floor) {
        return R.success(floorService.add(clientId,floor));
    }

    @GetMapping("/delete")
    public ResponseResult<?> delete(@RequestParam("id")String id) {
        return R.success(floorService.delete(id));
    }
}
